﻿package bdz.projects.lavender.doi.ui
{
	import bdz.common.events.GenericEvent;
	import bdz.common.managers.AudioControlManager;
	import bdz.projects.lavender.doi.ui.core.DOICoreView;
	import flash.display.MovieClip;
	
	/**
	 * ...
	 * @author ...
	 */
	public class DOIStepView extends DOICoreView 
	{

		private var stepElements:Array;
		private var stepAnimation:DOIStepAnimation;
		private var stepdescription:DOIStepDescription;
		
		function DOIStepView() {
			super();
		}
		private function renderStepElements():void {
			stepAnimation = new DOIStepAnimation(dsource.swfimage, dsource.audiourl, new XML(dsource.definition), { width:850, height:600 } );
			addChild(stepAnimation);
			
		}
		private function createStepElements():void {
			if (stepAnimation) {
				clearStepElements();
			}else {
				renderStepElements();
			}
		}
		private function clearStepElements():void {
			removeChild(stepAnimation);
		}
		override protected function renderComponent():void {	
			createStepElements();
		}
		public function set stepValues(s:Object):void {
			if (dsource) {
				dsource = s;
				stepAnimation.refreshContent(dsource.swfimage, dsource.audiourl, new XML(dsource.definition), { width:850, height:600 } );
			}else{
				dsource = s;
				createStepElements();
			}
		}
		
	}
	
}